#pragma once

#define OIS_DYNAMIC_LIB

#include"Ogre.h"
#include"OIS\OIS.h"
#include"FirstFrameListener.h"
#include"Components\Terrain\OgreTerrain.h"
#include"Components\Terrain\OgreTerrainGroup.h"

using namespace Ogre;
using namespace std;
using namespace OIS;

class FirstFrameListener: public FrameListener
{


public:


	FirstFrameListener(void);
	FirstFrameListener(FirstFrameListener& firstFrameListener);
	FirstFrameListener(RenderWindow*& renderWindow,Camera*& camera,Viewport*& viewport,SceneNode*& node,Entity*&,TerrainGroup*&);

	~FirstFrameListener(void);

private:

	InputManager* inputManager;
	Keyboard* keyboard;
	Camera* _camera;
	Mouse* _mouse;
	float moveSpeed;

	Viewport* _viewport;
	bool _comp1;
	bool _comp2;
	bool _comp3;

	bool _down1;
	bool _down2;
	bool _down3;

	float _walkingSpeed;
	Ogre::SceneNode* _node;

	Ogre::AnimationState* _aniState;
	Ogre::AnimationState* _aniStateTop;

	Ogre::TerrainGroup* terrainGroup;



public:

	bool  frameStarted(const FrameEvent& evt);
	bool  frameEnded(const FrameEvent& evt);
	bool  frameRenderQueued(const FrameEvent& evt);

public:

	float GetTerrainHeight(const Ogre::Vector3 & pos);

};

